import java.util.Arrays;
import java.util.Random;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: wwy
 * Date: 2024-05-07
 * Time: 12:46
 */
//给定一个有序整型数组, 实现二分查找
public class BS {
    public static void main(String[] args) {
        int[] array={2,0,4,54,5,46,4};
        Arrays.sort(array);
        System.out.println(Arrays.binarySearch(array,2));
    }
}
